﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DefaultArea.aspx.cs" Inherits="Score_Education_DefaultArea" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html  xmlns="http://www.w3.org/1999/xhtml"  style="height:100%">
<head >

    <title>成绩管理系统——教育局</title>
<link type="text/css" rel="stylesheet" href="../Common/css/main.css" />
<script type="text/javascript" src="../Common/Js/jquery.js"></script>
<script type="text/javascript" src="../Common/Js/common.js"></script>
<script type="text/javascript" src="../Common/Js/msg.js"></script>
     <style type="text/css">
     div{_behavior: url("../Common/css/iepngfix.htc") }

     </style> 
    <script type="text/javascript">
    var isExamOpened = false;
    var useManage = false;
    var useReport = false;
    //主导航
    function Navigate(itemIndex)
    {
        
        switch(itemIndex)
        {
            case 1://统考管理
//                if(useManage)
                {
                    document.getElementById("div1").style.display="none";
                    document.getElementById("div2").style.marginLeft="5px";

                    frames["leftFrame"].location.href="about:blank";
                    frames["mainFrame"].location.href="AreaManage/SituationManager.aspx";
                }
//                else
//                {
//                    showMassgeBox("提示","您没有权限进行统考管理",1,null);
//                   return;
//                }
                
            break;
            
            case 2://报表 
                if(isExamOpened)
                {
                    if(useReport)
                    {
                        document.getElementById("div2").style.marginLeft="200px";
                        document.getElementById("div1").style.display="inline";
        //                document.getElementById("leftFrame").style.display="block";
                        frames["leftFrame"].location.href="LeftArea.aspx";
                        frames["mainFrame"].location.href="about:blank";
                    }
                    else
                    {
                        showMassgeBox("提示","您没有权限查看报表",1,null);
                        return;
                    }
                }
                else
                {
                   showMassgeBox("提示","请您先打开要查看的考试",1,null);
                   return;
                }
            break;
        }   
        var id = "li"+itemIndex;
		SetStyle(id);    
    }
    
    function SetStyle(id)
    {
		document.getElementById(id).className="avtive";
		var ass = document.getElementById('divTabdddd').getElementsByTagName('a');

        if(ass != null)
        {
            for(var i =0;i < ass.length; i++)
            {
                var li = ass[i];
                if(li.id != id)
                {
                    li.className=""; 
                }
            }
        }
        
    }

//显示修改密码窗口
    function ShowUpdatePassword()
    {
        document.getElementById('pwd').value='';
        document.getElementById('newpwd1').value='';
        document.getElementById('newpwd2').value='';
        //显示修改密码对话框        
        ShowPopForm("upPwdPop", "upPwdPopTitle", "修改密码");
        //显示背景遮罩
        showMask();
    }
    
    function CloseMask(formId)
    {
        ClosePopForm(formId,true);
        hideMask();
    }
    
    function UpdatePassword()
    {
        var pwd = document.getElementById('pwd');
        var newpwd1 = document.getElementById('newpwd1');
        var newpwd2 = document.getElementById('newpwd2');
        if(pwd.value=="")
        {
        
            showNoticMsg('pwd', '密码不能为空');
            pwd.focus();
            return;
        }
        if(newpwd1.value=="")
        {
            showNoticMsg('newpwd1', '新密码不能为空');
            newpwd1.focus();
            return;
        }
         if(newpwd2.value=="")
        {
            showNoticMsg('newpwd2', '确认密码不能为空');
            newpwd2.focus();
            return;
        }
        
        if (getStringCount(pwd.value) >20)
        {
            showNoticMsg('pwd','密码不能大于20个字符');
            pwd.focus();              
            return;
        }
        
         if (getStringCount(newpwd1.value) >20)
        {
            showNoticMsg('newpwd1','密码不能大于20个字符');
            newpwd1.focus();              
            return;
        }
        
        if (getStringCount(newpwd2.value) >20)
        {
            showNoticMsg('newpwd2','密码不能大于20个字符');
            newpwd2.focus();              
            return;
        }
        
        if (containSpecialChar(pwd.value) == true)
        {
            showNoticMsg('pwd','密码不能含有特殊字符');
            pwd.focus();               
            return;
        }
        
        if (containSpecialChar(newpwd1.value) == true)
        {
            showNoticMsg('newpwd1','密码不能含有特殊字符');
            newpwd1.focus();               
            return;
        }
        
        if (containSpecialChar(newpwd2.value) == true)
        {
            showNoticMsg('newpwd2','密码不能含有特殊字符');
            newpwd2.focus();  
            return;
        }
                                
        
        if(newpwd2.value!=newpwd1.value)
        {
            newpwd1.value = '';
            newpwd2.value = '';
            showNoticMsg('newpwd1','新密码和确认密码必须相同');
            newpwd1.focus();
            return;
        }
        
        PageMethods.UpdatePwd(pwd.value, newpwd1.value, function(result){
            if(result > 0)
            {
                showMassgeBox("提示", '修改密码成功');
                ClosePopForm('upPwdPop');
            }
            else if (result == -1)
            {
                pwd.value = '';
                showNoticMsg('pwd','原密码不正确，请重新输入');
                pwd.focus();
            }
            else
            {
                pwd.value = '';
                showNoticMsg('pwd','修改密码失败，请重新修改');
                pwd.focus();
            }

        },function(err){ 
            showMassgeBox("提示",UPDATEPWD_EXCEPTION,1,null);
        });
        
    }
    
    //从cookie里获取打开学校考试
function GetCookie()
{ 
    openedExamName = "<%=GetOpenedExamName()%>";
    var nameObj = document.getElementById('txtOpenExam'); 
    if(nameObj != null)
    {
        if(openedExamName.length > 0)
            nameObj.innerText = "当前打开的考试是："+openedExamName;
        else
            nameObj.innerText = "当前没有打开的考试";
    }
}
    
    
    </script>
</head>

<body onload="GetCookie();" scroll="no"  style="height:100%">
 <form id="form1" runat="server"  style="height:100%">
 <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="True">
       </asp:ScriptManager>  
<div class="bodyWarp" oninit="OnInit()"  style="height:100%">
    <div class="pageHea" >
       <div class="navHea">
            <table border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td ><img src="../Common/images/top_2.gif" align="absmiddle" style="float:none;" /><a  href="../../main.aspx"  title="">首页</a>&nbsp;&nbsp;<img src="../Common/images/updatepass.gif" align="absmiddle" style="float:none;" /><a href="javascript:ShowUpdatePassword()" title="">修改密码</a>&nbsp;&nbsp;<img src="../Common/images/logout.gif" align="absmiddle" style="float:none;" /><a class="red" href="../../logout.aspx" title="">退出</a></td>
              </tr>
              <tr>
               <td></td>
                <td></td>
                <td></td>
                <td>用户：<%= CommonScore.GetUserName %>(<%= CommonScore.GetUserCode %>)</td>
                <td>角色：学区用户</td>
                <td>单位：教育局(<%=CommonScore.GetAreaName%>)</td>               
              </tr>
            </table>
        </div>
        
        
        
        <div class="menuHea" id ="divTabdddd">
        
        
     
        	<ul>
            	<li ><a href="javascript:Navigate(1)" id ="li1" title="">统考管理</a></li>
                <li  ><a   href="javascript:Navigate(2)" id ="li2" title="">报表查询</a></li>
            </ul>
            <span  id="txtOpenExam" ></span>
        </div>
        
        
        
        
<%--    	<h1></h1>
        <ul class="subNav ">
            <li style=" font-size:12px;font-family:'SimSun', Arial, Helvetica, sans-serif;"><%=GetLoginInfo()%></li>
            <li><a href="javascript:ShowUpdatePassword()" title="设置" style=" font-size:12px;font-family:'SimSun', Arial, Helvetica, sans-serif;">修改密码</a></li>
            <li><a  title="返回" href="../../main.aspx" style=" font-size:12px;font-family:'SimSun', Arial, Helvetica, sans-serif;">返回</a></li> 
            <li><a  title="退出" href="../../logout.aspx" style=" font-size:12px;font-family:'SimSun', Arial, Helvetica, sans-serif;">退出</a></li>
        </ul>--%>
   </div>
	<div class="pageBody" id="contentH" >

       <div class="pageLeft"  id="div1">
        	<iframe name="leftFrame" src="about:blank" style="height:100%; width:100%; overflow:auto;" frameborder="0"  marginwidth="0" marginheight="0" scrolling="No" ></iframe>
       </div>
       
       <div class="pageMain" id="div2">
            <iframe name="mainFrame" src="../Welcome.htm"style="height:100%;width:100%" frameborder="0" border="0" marginwidth="0" marginheight="0" ></iframe>
       </div>
    </div>
	<div class="pageFoot">
    	<a href="http://www.juwangtech.com/" title="武汉聚网科技有限公司">武汉聚网科技有限公司</a> 版权所有 @2009  全国免费服务热线：800-713-6688 电子邮箱：service@juwangtech.com
    </div>
    
    
    <!--END-->
</div>
 </form>
 <div id="upPwdPop" class="layoutWarp" style="display: none; width:400px;">
        <div class="title">
	        <span id="upPwdPopTitle"></span>
            <a title="关闭" onclick="return ClosePopForm('upPwdPop')">关闭</a>
          </div>
    <table border="0" class="layoutTable">
        <tr>
            <td width="107" align="right">原密码：</td>
            <td width="213" align="left"><INPUT onkeydown="" id="pwd" class="textInput" onfocus="" maxlength="20" type=password /></td>
        </tr>
        <tr>
            <td width="107" align="right">新密码：</td>
            <td width="213" align="left"><INPUT onkeydown="" id="newpwd1" class="textInput" onfocus="" maxlength="20" type=password /></td>
        </tr>
        <tr>
            <td width="107" align="right">确认新密码：</td>
            <td width="213" align="left"><INPUT onkeydown="" id="newpwd2" class="textInput" onfocus="" maxlength="20" type=password /></td>
        </tr>
        <tr>
            <td colspan ="2">
            <div align="center">
            <input name="btnReqClsOK" type="button" class="commonBut" id="btnReqClsOK" onclick="UpdatePassword();" value="确定" />
            <input name="btnReqClsCancel" type="button" class="commonBut" id="btnReqClsCancel"  onclick="return CloseMask('upPwdPop')" value="取消" />
            </div></td>
        </tr>
    </table>
    </div>
</body>
   
</html>   

    <script type="text/javascript">
        <%
            Response.Write("isExamOpened=" +  GetOpenedExamId() +";");
            SetUserPerm();
         %>
        Navigate(1);
        var c=document.body.scrollHeight;

        document.getElementById("contentH").style.height=(c-68-50)+"px";
    </script>